package GEMonitor;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.timeout.ReadTimeoutHandler;
//import io.netty.handler.logging.LogLevel;
//import io.netty.handler.logging.LoggingHandler;

public class GEServerInitializer extends ChannelInitializer<SocketChannel>
{

    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        ChannelPipeline pipeline = ch.pipeline();

//        pipeline.addLast(new LoggingHandler(LogLevel.INFO), new GEMsgDecoderServer(), new GEMsgEncoder(), new GEServerHandler());
        pipeline.addLast(new ReadTimeoutHandler(300), new GEMsgDecoderServer(), new GEMsgEncoder(), new GEServerHandler());
        pipeline.addLast(new ExceptionCaughtHandler());
    }
    
}